home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / FSM.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  34.4 KB  |  789 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        FSM.mod
  3.  
  4.      Contains:    HFS External File System Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE FSM;
  23.  
  24. IMPORT SYSTEM, Types, Files;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29.  
  30. CONST
  31. (*    The new volume mount flags *)
  32.     volMountInteractBit*            = 15;                            (* Input to VolumeMount*: If set, it's OK for the file system *)
  33.     volMountInteractMask*        = $8000;                        (* to perform user interaction to mount the volume *)
  34.     volMountChangedBit*            = 14;                            (* Output from VoumeMount*: If set, the volume was mounted, but *)
  35.     volMountChangedMask*            = $4000;                        (* the volume mounting information record needs to be updated. *)
  36.     volMountFSReservedMask*        = $00ff;                        (* bits 0-7 are defined by each file system for its own use *)
  37.     volMountSysReservedMask*        = $ff00;                        (* bits 8-15 are reserved for Apple system use *)
  38.  
  39. (*
  40.  * The new volume mount info record
  41.  *)
  42.  
  43. TYPE
  44.     VolumeMountInfoHeader* = RECORD
  45.         length*:                    INTEGER;                                (* length of location data (including self) *)
  46.         media*:                    Files.VolumeType;                                (* type of media (must be registered with Apple) *)
  47.         flags*:                    INTEGER;                                (* volume mount flags. Variable length data follows *)
  48.     END;
  49.  
  50.     VolumeMountInfoHeaderPtr* = POINTER TO VolumeMountInfoHeader;
  51.  
  52.  
  53. CONST
  54.     gestaltFSMVersion*            = LONG("fsm ");
  55.  
  56.     
  57. TYPE
  58.     VCBPtr* = POINTER TO Files.VCB;
  59.  
  60. (*
  61.  * Miscellaneous file system values not in Files.h
  62.  *)
  63.  
  64. CONST
  65.     fsUsrCNID*                    = 16;                            (* First assignable directory or file number *)
  66. (*    File system trap word attribute bits *)
  67.     kHFSBit*                        = 9;                            (* HFS call*: bit 9 *)
  68.     kHFSMask*                    = $0200;
  69.     kAsyncBit*                    = 10;                            (* Asynchronous call*: bit 10 *)
  70.     kAsyncMask*                    = $0400;
  71.  
  72. (*
  73.  * HFSCIProc selectCode values
  74.  * Note*: The trap attribute bits (the HFS bit and the asynchronous bit)
  75.  * may be set in these selectCode values.
  76.  *)
  77.     kFSMOpen*                    = $A000;
  78.     kFSMClose*                    = $A001;
  79.     kFSMRead*                    = $A002;
  80.     kFSMWrite*                    = $A003;
  81.     kFSMGetVolInfo*                = $A007;
  82.     kFSMCreate*                    = $A008;
  83.     kFSMDelete*                    = $A009;
  84.     kFSMOpenRF*                    = $A00A;
  85.     kFSMRename*                    = $A00B;
  86.     kFSMGetFileInfo*                = $A00C;
  87.     kFSMSetFileInfo*                = $A00D;
  88.     kFSMUnmountVol*                = $A00E;
  89.     kFSMMountVol*                = $A00F;
  90.     kFSMAllocate*                = $A010;
  91.     kFSMGetEOF*                    = $A011;
  92.     kFSMSetEOF*                    = $A012;
  93.     kFSMFlushVol*                = $A013;
  94.     kFSMGetVol*                    = $A014;
  95.     kFSMSetVol*                    = $A015;
  96.     kFSMEject*                    = $A017;
  97.     kFSMGetFPos*                    = $A018;
  98.     kFSMOffline*                    = $A035;
  99.     kFSMSetFilLock*                = $A041;
  100.     kFSMRstFilLock*                = $A042;
  101.     kFSMSetFilType*                = $A043;
  102.     kFSMSetFPos*                    = $A044;
  103.     kFSMFlushFile*                = $A045;
  104. (*    The File System HFSDispatch selectCodes *)
  105.     kFSMOpenWD*                    = $0001;
  106.     kFSMCloseWD*                    = $0002;
  107.     kFSMCatMove*                    = $0005;
  108.     kFSMDirCreate*                = $0006;
  109.     kFSMGetWDInfo*                = $0007;
  110.     kFSMGetFCBInfo*                = $0008;
  111.     kFSMGetCatInfo*                = $0009;
  112.     kFSMSetCatInfo*                = $000A;
  113.     kFSMSetVolInfo*                = $000B;
  114.     kFSMLockRng*                    = $0010;
  115.     kFSMUnlockRng*                = $0011;
  116.     kFSMCreateFileIDRef*            = $0014;
  117.     kFSMDeleteFileIDRef*            = $0015;
  118.     kFSMResolveFileIDRef*        = $0016;
  119.     kFSMExchangeFiles*            = $0017;
  120.     kFSMCatSearch*                = $0018;
  121.     kFSMOpenDF*                    = $001A;
  122.     kFSMMakeFSSpec*                = $001B;
  123. (*    The Desktop Manager HFSDispatch selectCodes *)
  124.     kFSMDTGetPath*                = $0020;
  125.     kFSMDTCloseDown*                = $0021;
  126.     kFSMDTAddIcon*                = $0022;
  127.     kFSMDTGetIcon*                = $0023;
  128.     kFSMDTGetIconInfo*            = $0024;
  129.     kFSMDTAddAPPL*                = $0025;
  130.     kFSMDTRemoveAPPL*            = $0026;
  131.     kFSMDTGetAPPL*                = $0027;
  132.     kFSMDTSetComment*            = $0028;
  133.     kFSMDTRemoveComment*            = $0029;
  134.     kFSMDTGetComment*            = $002A;
  135.     kFSMDTFlush*                    = $002B;
  136.     kFSMDTReset*                    = $002C;
  137.     kFSMDTGetInfo*                = $002D;
  138.     kFSMDTOpenInform*            = $002E;
  139.     kFSMDTDelete*                = $002F;
  140. (*    The AppleShare HFSDispatch selectCodes *)
  141.     kFSMGetVolParms*                = $0030;
  142.     kFSMGetLogInInfo*            = $0031;
  143.     kFSMGetDirAccess*            = $0032;
  144.     kFSMSetDirAccess*            = $0033;
  145.     kFSMMapID*                    = $0034;
  146.     kFSMMapName*                    = $0035;
  147.     kFSMCopyFile*                = $0036;
  148.     kFSMMoveRename*                = $0037;
  149.     kFSMOpenDeny*                = $0038;
  150.     kFSMOpenRFDeny*                = $0039;
  151.     kFSMGetXCatInfo*                = $003A;
  152.     kFSMGetVolMountInfoSize*        = $003F;
  153.     kFSMGetVolMountInfo*            = $0040;
  154.     kFSMVolumeMount*                = $0041;
  155.     kFSMShare*                    = $0042;
  156.     kFSMUnShare*                    = $0043;
  157.     kFSMGetUGEntry*                = $0044;
  158.     kFSMGetForeignPrivs*            = $0060;
  159.     kFSMSetForeignPrivs*            = $0061;
  160.  
  161. (*
  162.  * UTDetermineVol status values
  163.  *)
  164.     dtmvError*                    = 0;                            (* param error *)
  165.     dtmvFullPathame*                = 1;                            (* determined by full pathname *)
  166.     dtmvVRefNum*                    = 2;                            (* determined by volume refNum *)
  167.     dtmvWDRefNum*                = 3;                            (* determined by working directory refNum *)
  168.     dtmvDriveNum*                = 4;                            (* determined by drive number *)
  169.     dtmvDefault*                    = 5;                            (* determined by default volume *)
  170.  
  171. (*
  172.  * UTGetBlock options
  173.  *)
  174.     gbDefault*                    = 0;                            (* default value - read if not found *)
  175. (*    bits and masks *)
  176.     gbReadBit*                    = 0;                            (* read block from disk (forced read) *)
  177.     gbReadMask*                    = $0001;
  178.     gbExistBit*                    = 1;                            (* get existing cache block *)
  179.     gbExistMask*                    = $0002;
  180.     gbNoReadBit*                    = 2;                            (* don't read block from disk if not found in cache *)
  181.     gbNoReadMask*                = $0004;
  182.     gbReleaseBit*                = 3;                            (* release block immediately after GetBlock *)
  183.     gbReleaseMask*                = $0008;
  184.  
  185. (*
  186.  * UTReleaseBlock options
  187.  *)
  188.     rbDefault*                    = 0;                            (* default value - just mark the buffer not in-use *)
  189. (*    bits and masks *)
  190.     rbWriteBit*                    = 0;                            (* force write buffer to disk *)
  191.     rbWriteMask*                    = $0001;
  192.     rbTrashBit*                    = 1;                            (* trash buffer contents after release *)
  193.     rbTrashMask*                    = $0002;
  194.     rbDirtyBit*                    = 2;                            (* mark buffer dirty *)
  195.     rbDirtyMask*                    = $0004;
  196.     rbFreeBit*                    = 3;                            (* free the buffer (save in the hash) *)
  197. (*
  198.  *    rbFreeMask (rbFreeBit + rbTrashBit) works as rbTrash on < System 7.0 RamCache;
  199.  *    on >= System 7.0, rbfreeMask overrides rbTrash
  200.  *)
  201.     rbFreeMask*                    = $000A;
  202.  
  203. (*
  204.  * UTFlushCache options
  205.  *)
  206.     fcDefault*                    = 0;                            (* default value - just flush any dirty buffers *)
  207. (*    bits and masks *)
  208.     fcTrashBit*                    = 1;                            (* trash buffers after flushing *)
  209.     fcTrashMask*                    = $0002;
  210.     fcFreeBit*                    = 3;                            (* free buffers after flushing *)
  211.     fcFreeMask*                    = $0008;                        (* fcFreeMask works as fcTrash on < System 7.0 RamCache *)
  212.  
  213. (*
  214.  * UTCacheReadIP and UTCacheWriteIP cacheOption
  215.  *)
  216.     noCacheBit*                    = 5;                            (* don't cache this please *)
  217.     noCacheMask*                    = $0020;
  218.     rdVerifyBit*                    = 6;                            (* read verify *)
  219.     rdVerifyMask*                = $0040;
  220.  
  221. (*
  222.  * Cache routine internal error codes
  223.  *)
  224.     chNoBuf*                        = 1;                            (* no free cache buffers (all in use) *)
  225.     chInUse*                        = 2;                            (* requested block in use *)
  226.     chnotfound*                    = 3;                            (* requested block not found *)
  227.     chNotInUse*                    = 4;                            (* block being released was not in use *)
  228.  
  229. (*
  230.  * FCBRec.fcbFlags bits
  231.  *)
  232.     fcbWriteBit*                    = 0;                            (* Data can be written to this file *)
  233.     fcbWriteMask*                = $01;
  234.     fcbResourceBit*                = 1;                            (* This file is a resource fork *)
  235.     fcbResourceMask*                = $02;
  236.     fcbWriteLockedBit*            = 2;                            (* File has a locked byte range *)
  237.     fcbWriteLockedMask*            = $04;
  238.     fcbSharedWriteBit*            = 4;                            (* File is open for shared write access *)
  239.     fcbSharedWriteMask*            = $10;
  240.     fcbFileLockedBit*            = 5;                            (* File is locked (write-protected) *)
  241.     fcbFileLockedMask*            = $20;
  242.     fcbOwnClumpBit*                = 6;                            (* File has clump size specified in FCB *)
  243.     fcbOwnClumpMask*                = $40;
  244.     fcbModifiedBit*                = 7;                            (* File has changed since it was last flushed *)
  245.     fcbModifiedMask*                = $80;
  246.  
  247. (*
  248.  * ExtFileProc options
  249.  *)
  250.     extendFileAllBit*            = 0;                            (* allocate all requested bytes or none *)
  251.     extendFileAllMask*            = $0001;
  252.     extendFileContigBit*            = 1;                            (* force contiguous allocation *)
  253.     extendFileContigMask*        = $0002;
  254.  
  255. (*
  256.  *    HFS Components.Component Interface constants
  257.  *)
  258. (*
  259.  * compInterfMask bits specific to HFS component
  260.  *)
  261.     hfsCIDoesHFSBit*                = 23;                            (* set if file system supports HFS calls *)
  262.     hfsCIDoesHFSMask*            = $00800000;
  263.     hfsCIDoesAppleShareBit*        = 22;                            (* set if AppleShare calls supported *)
  264.     hfsCIDoesAppleShareMask*        = $00400000;
  265.     hfsCIDoesDeskTopBit*            = 21;                            (* set if Desktop Database calls supported *)
  266.     hfsCIDoesDeskTopMask*        = $00200000;
  267.     hfsCIDoesDynamicLoadBit*        = 20;                            (* set if dynamically loading code resource *)
  268.     hfsCIDoesDynamicLoadMask*    = $00100000;                    (*        supported *)
  269.     hfsCIResourceLoadedBit*        = 19;                            (* set if code resource already loaded *)
  270.     hfsCIResourceLoadedMask*        = $00080000;
  271.     hfsCIHasHLL2PProcBit*        = 18;                            (* set if FFS' log2PhyProc and Extendfile proc *)
  272.     hfsCIHasHLL2PProcMask*        = $00040000;                    (* is written in a high level language. (i.e., uses Pascal calling convention) *)
  273.  
  274. (*
  275.  *    Disk Initialization Components.Component Interface constants
  276.  *)
  277. (*
  278.  * compInterfMask bits specific to Disk Initialization component
  279.  *)
  280.     diCIHasExtFormatParamsBit*    = 18;                            (* set if file system needs extended format *)
  281.     diCIHasExtFormatParamsMask*    = $00040000;                    (*        parameters *)
  282.     diCIHasMultiVolTypesBit*        = 17;                            (* set if file system supports more than one *)
  283.     diCIHasMultiVolTypesMask*    = $00020000;                    (*        volume type *)
  284.     diCIDoesSparingBit*            = 16;                            (* set if file system supports disk sparing *)
  285.     diCIDoesSparingMask*            = $00010000;
  286.     diCILiveBit*                    = 0;                            (* set if file system is candidate for current *)
  287.     diCILiveMask*                = $00000001;                    (*        formatting operation (set by PACK2) *)
  288.  
  289. (*
  290.  * Disk Initialization Components.Component Function selectors
  291.  *)
  292.     diCILoad*                    = 1;                            (* Make initialization code memory resident *)
  293.     diCIUnload*                    = 2;                            (* Make initialization code purgeable *)
  294.     diCIEvaluateSizeChoices*        = 3;                            (* Evaluate size choices *)
  295.     diCIExtendedZero*            = 4;                            (* Write an empty volume directory *)
  296.     diCIValidateVolName*            = 5;                            (* Validate volume name *)
  297.     diCIGetVolTypeInfo*            = 6;                            (* get volume type info *)
  298.     diCIGetFormatString*            = 7;                            (* get dialog format string *)
  299.     diCIGetExtFormatParams*        = 8;                            (* get extended format parameters *)
  300.     diCIGetDefectList*            = 9;                            (* return the defect list for the indicated disk - reserved for future use *)
  301.  
  302. (*
  303.  * Constants used in the DICIEvaluateSizeRec and FormatListRec
  304.  *)
  305.     diCIFmtListMax*                = 8;                            (* maximum number of format list entries in DICIEvaluateSizeRec.numSizeEntries *)
  306. (*    bits in FormatListRec.formatFlags: *)
  307.     diCIFmtFlagsValidBit*        = 7;                            (* set if sec, side, tracks valid *)
  308.     diCIFmtFlagsValidMask*        = $80;
  309.     diCIFmtFlagsCurrentBit*        = 6;                            (* set if current disk has this fmt *)
  310.     diCIFmtFlagsCurrentMask*        = $40;
  311. (*    bits in FormatListRec.sizeListFlags: *)
  312.     diCISizeListOKBit*            = 15;                            (* set if this disk size usable *)
  313.     diCISizeListOKMask*            = $8000;
  314.  
  315. (*
  316.  * DICIGetFormatStringRec.stringKind format strings
  317.  *)
  318.     diCIAlternateFormatStr*        = 1;                            (* get alternate format  string (Balloon Help) *)
  319.     diCISizePresentationStr*        = 2;                            (* get size presentation string (for dialog) *)
  320.  
  321. (*
  322.  * Error codes returned by Disk Sparing
  323.  *)
  324.     diCIUserCancelErr*            = 1;                            (* user cancelled the disk init *)
  325.     diCICriticalSectorBadErr*    = 20;                            (* critical sectors are bad (hopeless)    *)
  326.     diCISparingFailedErr*        = 21;                            (* disk cannot be spared *)
  327.     diCITooManyBadSectorsErr*    = 22;                            (* too many bad sectors *)
  328.     diCIUnknownVolTypeErr*        = 23;                            (* the volume type passed in diCIExtendedZero paramBlock is not supported *)
  329.     diCIVolSizeMismatchErr*        = 24;                            (* specified volume size doesn’t match with formatted disk size *)
  330.     diCIUnknownDICallErr*        = 25;                            (* bogus DI function call selector *)
  331.     diCINoSparingErr*            = 26;                            (* disk is bad but the target FS doesn't do disk sparing *)
  332.     diCINoExtendInfoErr*            = 27;                            (* missing file system specific extra parameter in diCIExtendedZero call *)
  333.     diCINoMessageTextErr*        = 28;                            (* missing message text in DIReformat call *)
  334.  
  335. (*
  336.  *    File System Manager constants
  337.  *)
  338. (*
  339.  * Miscellaneous constants used by FSM
  340.  *)
  341.     fsdVersion1*                    = 1;                            (* current version of FSD record *)
  342.     fsmIgnoreFSID*                = $fffe;                        (* this FSID should be ignored by the driver *)
  343.     fsmGenericFSID*                = $ffff;                        (* unknown foreign file system AIFF.ID *)
  344.  
  345. (*
  346.  * compInterfMask bits common to all FSM components
  347.  *)
  348.     fsmComponentEnableBit*        = 31;                            (* set if FSM component interface is enabled *)
  349.     fsmComponentEnableMask*        = $80000000;
  350.     fsmComponentBusyBit*            = 30;                            (* set if FSM component interface is busy *)
  351.     fsmComponentBusyMask*        = $40000000;
  352.  
  353. (*
  354.  * Selectors for GetFSInfo
  355.  *)
  356.     fsmGetFSInfoByIndex*            = -1;                            (* get fs info by index *)
  357.     fsmGetFSInfoByFSID*            = 0;                            (* get fs info by FSID *)
  358.     fsmGetFSInfoByRefNum*        = 1;                            (* get fs info by file/vol refnum *)
  359.  
  360. (*
  361.  * InformFSM messages
  362.  *)
  363.     fsmNopMessage*                = 0;                            (* nop *)
  364.     fsmDrvQElChangedMessage*        = 1;                            (* DQE has changed *)
  365.     fsmGetFSIconMessage*            = 2;                            (* Get FFS's disk icon *)
  366.  
  367. (*
  368.  * Messages passed to the fileSystemCommProc
  369.  *)
  370.     ffsNopMessage*                = 0;                            (* nop, should always return noErr *)
  371.     ffsGetIconMessage*            = 1;                            (* return disk icon and mask *)
  372.     ffsIDDiskMessage*            = 2;                            (* identify the about-to-be-mounted volume *)
  373.     ffsLoadMessage*                = 3;                            (* load in the FFS *)
  374.     ffsUnloadMessage*            = 4;                            (* unload the FFS *)
  375.     ffsIDVolMountMessage*        = 5;                            (* identify a VolMountInfo record *)
  376.     ffsInformMessage*            = 6;                            (* FFS defined message *)
  377.     ffsGetIconInfoMessage*        = 7;
  378.  
  379. (*
  380.  * Error codes from FSM functions
  381.  *)
  382.     fsmFFSNotFoundErr*            = -431;                            (* Foreign File system does not exist - new Pack2 could return this error too *)
  383.     fsmBusyFFSErr*                = -432;                            (* File system is busy, cannot be removed *)
  384.     fsmBadFFSNameErr*            = -433;                            (* Name length not 1 <= length <= 31 *)
  385.     fsmBadFSDLenErr*                = -434;                            (* FSD size incompatible with current FSM vers *)
  386.     fsmDuplicateFSIDErr*            = -435;                            (* FSID already exists on InstallFS *)
  387.     fsmBadFSDVersionErr*            = -436;                            (* FSM version incompatible with FSD *)
  388.     fsmNoAlternateStackErr*        = -437;                            (* no alternate stack for HFS CI *)
  389.     fsmUnknownFSMMessageErr*        = -438;                            (* unknown message passed to FSM *)
  390.  
  391. (*
  392.  *    HFS Utility routine records
  393.  *)
  394. (*
  395.  * record used by UTGetPathComponentName
  396.  *)
  397.  
  398. TYPE
  399.     ParsePathRec* = RECORD
  400.         namePtr*:                Types.StringPtr;                                (* pathname to parse *)
  401.         startOffset*:            INTEGER;                                (* where to start parsing *)
  402.         componentLength*:        INTEGER;                                (* the length of the pathname component parsed *)
  403.         moreName*:                Types.SignedByte;                                (* non-zero if there are more components after this one *)
  404.         foundDelimiter*:            Types.SignedByte;                                (* non-zero if parsing stopped because a colon (:) delimiter was found *)
  405.     END;
  406.  
  407.     ParsePathRecPtr* = POINTER TO ParsePathRec;
  408.  
  409.     WDCBRec* = RECORD
  410.         wdVCBPtr*:                VCBPtr;                                    (* Pointer to OSUtils.VCB of this working directory *)
  411.         wdDirID*:                LONGINT;                                (* Directory AIFF.ID number of this working directory *)
  412.         wdCatHint*:                LONGINT;                                (* Hint for finding this working directory *)
  413.         wdProcID*:                LONGINT;                                (* Process that created this working directory *)
  414.     END;
  415.  
  416.     WDCBRecPtr* = POINTER TO WDCBRec;
  417.  
  418.     FCBRec* = RECORD
  419.         fcbFlNm*:                LONGINT;                                (* FCB file number. Non-zero marks FCB used *)
  420.         fcbFlags*:                Types.SignedByte;                                (* FCB flags *)
  421.         fcbTypByt*:                Types.SignedByte;                                (* File type byte *)
  422.         fcbSBlk*:                INTEGER;                                (* File start block (in alloc size blks) *)
  423.         fcbEOF*:                    LONGINT;                                (* Logical length or EOF in bytes *)
  424.         fcbPLen*:                LONGINT;                                (* Physical file length in bytes *)
  425.         fcbCrPs*:                LONGINT;                                (* Current position within file *)
  426.         fcbVPtr*:                VCBPtr;                                    (* Pointer to the corresponding OSUtils.VCB *)
  427.         fcbBfAdr*:                Types.Ptr;                                    (* File's buffer address *)
  428.         fcbFlPos*:                INTEGER;                                (* Directory block this file is in *)
  429.         (* FCB Extensions for HFS *)
  430.         fcbClmpSize*:            LONGINT;                                (* Number of bytes per clump *)
  431.         fcbBTCBPtr*:                Types.Ptr;                                    (* Pointer to B*-Tree control block for file *)
  432.         fcbExtRec*:                ARRAY 3 (*ΔΔ[0..2]ΔΔ*) OF LONGINT;                (* First 3 file extents *)
  433.         fcbFType*:                Types.OSType;                                    (* File's 4 Finder Type bytes *)
  434.         fcbCatPos*:                LONGINT;                                (* Catalog hint for use on Close *)
  435.         fcbDirID*:                LONGINT;                                (* Parent Directory AIFF.ID *)
  436.         fcbCName*:                Types.Str31;                                    (* CName of open file *)
  437.     END;
  438.  
  439.     FCBRecPtr* = POINTER TO FCBRec;
  440.  
  441. (*
  442.  *    HFS Components.Component Interface records
  443.  *)
  444.     Lg2PhysProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (fsdGlobalPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; volCtrlBlockPtr: VCBPtr; fileCtrlBlockPtr: FCBRecPtr; fileRefNum: INTEGER; filePosition: LONGINT; reqCount: LONGINT; VAR volOffset: LONGINT; VAR contiguousBytes: LONGINT): Types.OSErr;
  445.     Lg2PhysUPP* = Types.UniversalProcPtr;
  446.  
  447. CONST
  448.     uppLg2PhysProcInfo* = $003FEFE0; (* PROCEDURE (4 byte param, 4 byte param, 4 byte param, 2 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; *)
  449.  
  450. PROCEDURE NewLg2PhysProc*(userRoutine: Lg2PhysProcPtr): Lg2PhysUPP;
  451.     (*$IF NOT GENERATINGCFM *)
  452.     INLINE PASCAL $2E9F;
  453.     (*$END*)
  454.  
  455. PROCEDURE CallLg2PhysProc*(fsdGlobalPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; volCtrlBlockPtr: VCBPtr; fileCtrlBlockPtr: FCBRecPtr; fileRefNum: INTEGER; filePosition: LONGINT; reqCount: LONGINT; VAR volOffset: LONGINT; VAR contiguousBytes: LONGINT; userRoutine: Lg2PhysUPP): Types.OSErr;
  456.     (*$IF NOT GENERATINGCFM*)
  457.     INLINE PASCAL $205F, $4E90;
  458.     (*$END*)
  459. TYPE
  460.     HFSCIProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (theVCB: VCBPtr; selectCode: INTEGER; paramBlock: (*ΔΔUNIVΔΔ*) Types.Ptr; fsdGlobalPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; fsid: INTEGER): Types.OSErr;
  461.     HFSCIUPP* = Types.UniversalProcPtr;
  462.  
  463. CONST
  464.     uppHFSCIProcInfo* = $0000BEE0; (* PROCEDURE (4 byte param, 2 byte param, 4 byte param, 4 byte param, 2 byte param): 2 byte result; *)
  465.  
  466. PROCEDURE NewHFSCIProc*(userRoutine: HFSCIProcPtr): HFSCIUPP;
  467.     (*$IF NOT GENERATINGCFM *)
  468.     INLINE PASCAL $2E9F;
  469.     (*$END*)
  470.  
  471. PROCEDURE CallHFSCIProc*(theVCB: VCBPtr; selectCode: INTEGER; paramBlock: (*ΔΔUNIVΔΔ*) Types.Ptr; fsdGlobalPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; fsid: INTEGER; userRoutine: HFSCIUPP): Types.OSErr;
  472.     (*$IF NOT GENERATINGCFM*)
  473.     INLINE PASCAL $205F, $4E90;
  474.     (*$END*)
  475.  
  476. TYPE
  477.     HFSCIRec* = RECORD
  478.         compInterfMask*:            LONGINT;                                (* component flags *)
  479.         compInterfProc*:            HFSCIUPP;                                (* pointer to file system call processing code *)
  480.         log2PhyProc*:            Lg2PhysUPP;                                (* pointer to Lg2PhysProc() code *)
  481.         stackTop*:                Types.Ptr;                                    (* file system stack top *)
  482.         stackSize*:                LONGINT;                                (* file system stack size *)
  483.         stackPtr*:                Types.Ptr;                                    (* current file system stack pointer *)
  484.         reserved3*:                LONGINT;                                (* --reserved, must be zero-- *)
  485.         idSector*:                LONGINT;                                (* Sector you need to AIFF.ID a local volume. For networked volumes, this must be -1 *)
  486.         reserved2*:                LONGINT;                                (* --reserved, must be zero-- *)
  487.         reserved1*:                LONGINT;                                (* --reserved, must be zero-- *)
  488.     END;
  489.  
  490.     HFSCIRecPtr* = POINTER TO HFSCIRec;
  491.  
  492. (*
  493.  *    Disk Initialization Components.Component Interface records
  494.  *)
  495.     DICIProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (whatFunction: INTEGER; paramBlock: (*ΔΔUNIVΔΔ*) Types.Ptr; fsdGlobalPtr: (*ΔΔUNIVΔΔ*) Types.Ptr): Types.OSErr;
  496.     DICIUPP* = Types.UniversalProcPtr;
  497.  
  498. CONST
  499.     uppDICIProcInfo* = $00000FA0; (* PROCEDURE (2 byte param, 4 byte param, 4 byte param): 2 byte result; *)
  500.  
  501. PROCEDURE NewDICIProc*(userRoutine: DICIProcPtr): DICIUPP;
  502.     (*$IF NOT GENERATINGCFM *)
  503.     INLINE PASCAL $2E9F;
  504.     (*$END*)
  505.  
  506. PROCEDURE CallDICIProc*(whatFunction: INTEGER; paramBlock: (*ΔΔUNIVΔΔ*) Types.Ptr; fsdGlobalPtr: (*ΔΔUNIVΔΔ*) Types.Ptr; userRoutine: DICIUPP): Types.OSErr;
  507.     (*$IF NOT GENERATINGCFM*)
  508.     INLINE PASCAL $205F, $4E90;
  509.     (*$END*)
  510.  
  511. TYPE
  512.     DICIRec* = RECORD
  513.         compInterfMask*:            LONGINT;                                (* component flags *)
  514.         compInterfProc*:            DICIUPP;                                (* pointer to call processing code *)
  515.         maxVolNameLength*:        INTEGER;                                (* maximum length of your volume name *)
  516.         blockSize*:                INTEGER;                                (* your file system's block size *)
  517.         reserved3*:                LONGINT;                                (* --reserved, must be zero-- *)
  518.         reserved2*:                LONGINT;                                (* --reserved, must be zero-- *)
  519.         reserved1*:                LONGINT;                                (* --reserved, must be zero-- *)
  520.     END;
  521.  
  522.     DICIRecPtr* = POINTER TO DICIRec;
  523.  
  524. (*
  525.  * FormatListRec as returned by the .Sony disk driver's
  526.  * Return Format List status call (csCode* = 6).
  527.  * If the status call to get this list for a drive is not
  528.  * implemented by the driver, then a list with one entry
  529.  * is contructed from the drive queue element for the drive.
  530.  *)
  531.     FormatListRec* = RECORD
  532.         volSize*:                LONGINT;                                (* disk capacity in SECTORs *)
  533.         formatFlags*:            Types.SignedByte;                                (* flags *)
  534.         sectorsPerTrack*:        Types.SignedByte;                                (* sectors per track side *)
  535.         tracks*:                    INTEGER;                                (* number of tracks *)
  536.     END;
  537.  
  538.     FormatListRecPtr* = POINTER TO FormatListRec;
  539.  
  540. (*
  541.  * SizeListRec built from FormatListRecs as described above.
  542.  *)
  543.     SizeListRec* = RECORD
  544.         sizeListFlags*:            INTEGER;                                (* flags as set by external file system *)
  545.         sizeEntry*:                FormatListRec;                            (* disk driver format list record *)
  546.     END;
  547.  
  548.     SizeListRecPtr* = POINTER TO SizeListRec;
  549.  
  550. (*
  551.  * paramBlock for the diCIEvaluateSize call
  552.  *)
  553.     DICIEvaluateSizeRec* = RECORD
  554.         defaultSizeIndex*:        INTEGER;                                (* default size for this FS *)
  555.         numSizeEntries*:            INTEGER;                                (* number of size entries *)
  556.         driveNumber*:            INTEGER;                                (* drive number *)
  557.         sizeListPtr*:            SizeListRecPtr;                            (* ptr to size entry table *)
  558.         sectorSize*:                INTEGER;                                (* bytes per sector *)
  559.     END;
  560.  
  561.     DICIEvaluateSizeRecPtr* = POINTER TO DICIEvaluateSizeRec;
  562.  
  563. (*
  564.  * paramBlock for the diCIExtendedZero call
  565.  *)
  566.     DICIExtendedZeroRec* = RECORD
  567.         driveNumber*:            INTEGER;                                (* drive number *)
  568.         volNamePtr*:                Types.StringPtr;                                (* ptr to volume name string *)
  569.         fsid*:                    INTEGER;                                (* file system AIFF.ID *)
  570.         volTypeSelector*:        INTEGER;                                (* volume type selector, if supports more than 1 type *)
  571.         numDefectBlocks*:        INTEGER;                                (* number of bad logical blocks *)
  572.         defectListSize*:            INTEGER;                                (* size of the defect list buffer in bytes *)
  573.         defectListPtr*:            Types.Ptr;                                    (* pointer to defect list buffer *)
  574.         volSize*:                LONGINT;                                (* size of volume in SECTORs *)
  575.         sectorSize*:                INTEGER;                                (* bytes per sector *)
  576.         extendedInfoPtr*:        Types.Ptr;                                    (* ptr to extended info *)
  577.     END;
  578.  
  579.     DICIExtendedZeroRecPtr* = POINTER TO DICIExtendedZeroRec;
  580.  
  581. (*
  582.  * paramBlock for the diCIValidateVolName call
  583.  *)
  584.     DICIValidateVolNameRec* = (*ΔΔPACKEDΔΔ*) RECORD
  585.         theChar*:                CHAR;                                    (* the character to validate *)
  586.         hasMessageBuffer*:        BOOLEAN;                                (* false if no message *)
  587.         charOffset*:                INTEGER;                                (* position of the current character (first char* = 1) *)
  588.         messageBufferPtr*:        Types.StringPtr;                                (* pointer to message buffer or nil *)
  589.         charByteType*:            INTEGER;                                (* theChar's byte type (smSingleByte, smFirstByte, or smLastByte) *)
  590.     END;
  591.  
  592.     DICIValidateVolNameRecPtr* = POINTER TO DICIValidateVolNameRec;
  593.  
  594. (*
  595.  * paramBlock for the diCIGetVolTypeInfo call
  596.  *)
  597.     DICIGetVolTypeInfoRec* = RECORD
  598.         volSize*:                LONGINT;                                (* size of volume in SECTORs *)
  599.         sectorSize*:                INTEGER;                                (* bytes per sector *)
  600.         numVolTypes*:            INTEGER;                                (* number of volume types supported *)
  601.         volTypesBuffer*:            ARRAY 4 (*ΔΔ[0..3]ΔΔ*) OF Types.Str31;                    (* 4 string buffers *)
  602.     END;
  603.  
  604.     DICIGetVolTypeInfoRecPtr* = POINTER TO DICIGetVolTypeInfoRec;
  605.  
  606. (*
  607.  * paramBlock for the diCIGetFormatString call
  608.  *)
  609.     DICIGetFormatStringRec* = RECORD
  610.         volSize*:                LONGINT;                                (* volume size in SECTORs *)
  611.         sectorSize*:                INTEGER;                                (* sector size *)
  612.         volTypeSelector*:        INTEGER;                                (* volume type selector *)
  613.         stringKind*:                INTEGER;                                (* sub-function* = type of string *)
  614.         stringBuffer*:            Types.Str255;                                    (* string buffer *)
  615.     END;
  616.  
  617.     DICIGetFormatStringRecPtr* = POINTER TO DICIGetFormatStringRec;
  618.  
  619. (*
  620.  * paramBlock for the diCIGetExtendedFormatParams call
  621.  *)
  622.     DICIGetExtendedFormatRec* = RECORD
  623.         driveNumber*:            INTEGER;                                (* drive number *)
  624.         volTypeSelector*:        INTEGER;                                (* volume type selector or 0 *)
  625.         volSize*:                LONGINT;                                (* size of volume in SECTORileRefNum: INTEGER; VAR fileCtrlBlockPtr: FCBRecPtr): Types.OSErr;
  626.     (*$IF NOT GENERATINGCFM*)
  627.     INLINE PASCAL $7005, $A824;
  628.     (*$END*)
  629. PROCEDURE UTAllocateVCB*(VAR sysVCBLength: INTEGER; VAR volCtrlBlockPtr: VCBPtr; addSize: INTEGER): Types.OSErr;
  630.     (*$IF NOT GENERATINGCFM*)
  631.     INLINE PASCAL $7006, $A824;
  632.     (*$END*)
  633. PROCEDURE UTAddNewVCB*(driveNum: INTEGER; VAR vRefNum: INTEGER; volCtrlBlockPtr: VCBPtr): Types.OSErr;
  634.     (*$IF NOT GENERATINGCFM*)
  635.     INLINE PASCAL $7007, $A824;
  636.     (*$END*)
  637. PROCEDURE UTDisposeVCB*(volCtrlBlockPtr: VCBPtr): Types.OSErr;
  638.     (*$IF NOT GENERATINGCFM*)
  639.     INLINE PASCAL $7008, $A824;
  640.     (*$END*)
  641. PROCEDURE UTLocateVCBByRefNum*(refNum: INTEGER; VAR vRefNum: INTEGER; VAR volCtrlBlockPtr: VCBPtr): Types.OSErr;
  642.     (*$IF NOT GENERATINGCFM*)
  643.     INLINE PASCAL $7009, $A824;
  644.     (*$END*)
  645. PROCEDURE UTLocateVCBByName*(namePtr: Types.StringPtr; VAR moreMatches: INTEGER; VAR vRefNum: INTEGER; VAR volCtrlBlockPtr: VCBPtr): Types.OSErr;
  646.     (*$IF NOT GENERATINGCFM*)
  647.     INLINE PASCAL $700A, $A824;
  648.     (*$END*)
  649. PROCEDURE UTLocateNextVCB*(namePtr: Types.StringPtr; VAR moreMatches: INTEGER; VAR vRefNum: INTEGER; VAR volCtrlBlockPtr: VCBPtr): Types.OSErr;
  650.     (*$IF NOT GENERATINGCFM*)
  651.     INLINE PASCAL $700B, $A824;
  652.     (*$END*)
  653. PROCEDURE UTAllocateWDCB*(paramBlock: Files.WDPBPtr): Types.OSErr;
  654.     (*$IF NOT GENERATINGCFM*)
  655.     INLINE PASCAL $700C, $A824;
  656.     (*$END*)
  657. PROCEDURE UTReleaseWDCB*(wdRefNum: INTEGER): Types.OSErr;
  658.     (*$IF NOT GENERATINGCFM*)
  659.     INLINE PASCAL $700D, $A824;
  660.     (*$END*)
  661. PROCEDURE UTResolveWDCB*(procID: LONGINT; wdIndex: INTEGER; wdRefNum: INTEGER; VAR wdCtrlBlockPtr: WDCBRecPtr): Types.OSErr;
  662.     (*$IF NOT GENERATINGCFM*)
  663.     INLINE PASCAL $700E, $A824;
  664.     (*$END*)
  665. PROCEDURE UTFindDrive*(driveNum: INTEGER; VAR driveQElementPtr: Files.DrvQElPtr): Types.OSErr;
  666.     (*$IF NOT GENERATINGCFM*)
  667.     INLINE PASCAL $700F, $A824;
  668.     (*$END*)
  669. PROCEDURE UTAdjustEOF*(fileRefNum: INTEGER): Types.OSErr;
  670.     (*$IF NOT GENERATINGCFM*)
  671.     INLINE PASCAL $7010, $A824;
  672.     (*$END*)
  673. PROCEDURE UTSetDefaultVol*(nodeHint: LONGINT; dirID: LONGINT; refNum: INTEGER): Types.OSErr;
  674.     (*$IF NOT GENERATINGCFM*)
  675.     INLINE PASCAL $7011, $A824;
  676.     (*$END*)
  677. PROCEDURE UTGetDefaultVol*(paramBlock: Files.WDPBPtr): Types.OSErr;
  678.     (*$IF NOT GENERATINGCFM*)
  679.     INLINE PASCAL $7012, $A824;
  680.     (*$END*)
  681. PROCEDURE UTEjectVol*(volCtrlBlockPtr: VCBPtr): Types.OSErr;
  682.     (*$IF NOT GENERATINGCFM*)
  683.     INLINE PASCAL $702B, $A824;
  684.     (*$END*)
  685. PROCEDURE UTCheckWDRefNum*(wdRefNum: INTEGER): Types.OSErr;
  686.     (*$IF NOT GENERATINGCFM*)
  687.     INLINE PASCAL $7013, $A824;
  688.     (*$END*)
  689. PROCEDURE UTCheckFileRefNum*(fileRefNum: INTEGER): Types.OSErr;
  690.     (*$IF NOT GENERATINGCFM*)
  691.     INLINE PASCAL $7014, $A824;
  692.     (*$END*)
  693. PROCEDURE UTCheckVolRefNum*(vRefNum: INTEGER): Types.OSErr;
  694.     (*$IF NOT GENERATINGCFM*)
  695.     INLINE PASCAL $7015, $A824;
  696.     (*$END*)
  697. PROCEDURE UTCheckPermission*(volCtrlBlockPtr: VCBPtr; VAR modByte: INTEGER; fileNum: LONGINT; paramBlock: Files.ParmBlkPtr): Types.OSErr;
  698.     (*$IF NOT GENERATINGCFM*)
  699.     INLINE PASCAL $7016, $A824;
  700.     (*$END*)
  701. PROCEDURE UTCheckVolOffline*(vRefNum: INTEGER): Types.OSErr;
  702.     (*$IF NOT GENERATINGCFM*)
  703.     INLINE PASCAL $7017, $A824;
  704.     (*$END*)
  705. PROCEDURE UTCheckVolModifiable*(vRefNum: INTEGER): Types.OSErr;
  706.     (*$IF NOT GENERATINGCFM*)
  707.     INLINE PASCAL $7018, $A824;
  708.     (*$END*)
  709. PROCEDURE UTCheckFileModifiable*(fileRefNum: INTEGER): Types.OSErr;
  710.     (*$IF NOT GENERATINGCFM*)
  711.     INLINE PASCAL $7019, $A824;
  712.     (*$END*)
  713. PROCEDURE UTCheckDirBusy*(volCtrlBlockPtr: VCBPtr; dirID: LONGINT): Types.OSErr;
  714.     (*$IF NOT GENERATINGCFM*)
  715.     INLINE PASCAL $701A, $A824;
  716.     (*$END*)
  717. PROCEDURE UTParsePathname*(VAR volNamelength: INTEGER; namePtr: Types.StringPtr): Types.OSErr;
  718.     (*$IF NOT GENERATINGCFM*)
  719.     INLINE PASCAL $701B, $A824;
  720.     (*$END*)
  721. PROCEDURE UTGetPathComponentName*(parseRec: ParsePathRecPtr): Types.OSErr;
  722.     (*$IF NOT GENERATINGCFM*)
  723.     INLINE PASCAL $701C, $A824;
  724.     (*$END*)
  725. PROCEDURE UTDetermineVol*(paramBlock: Files.ParmBlkPtr; VAR status: INTEGER; VAR moreMatches: INTEGER; VAR vRefNum: INTEGER; VAR volCtrlBlockPtr: VCBPtr): Types.OSErr;
  726.     (*$IF NOT GENERATINGCFM*)
  727.     INLINE PASCAL $701D, $A824;
  728.     (*$END*)
  729. PROCEDURE UTGetBlock*(refNum: INTEGER; log2PhyProc: (*ΔΔUNIVΔΔ*) Types.Ptr; blockNum: LONGINT; gbOption: INTEGER; VAR buffer: Types.Ptr): Types.OSErr;
  730.     (*$IF NOT GENERATINGCFM*)
  731.     INLINE PASCAL $701F, $A824;
  732.     (*$END*)
  733. PROCEDURE UTReleaseBlock*(buffer: Types.Ptr; rbOption: INTEGER): Types.OSErr;
  734.     (*$IF NOT GENERATINGCFM*)
  735.     INLINE PASCAL $7020, $A824;
  736.     (*$END*)
  737. PROCEDURE UTFlushCache*(refNum: INTEGER; fcOption: INTEGER): Types.OSErr;
  738.     (*$IF NOT GENERATINGCFM*)
  739.     INLINE PASCAL $7021, $A824;
  740.     (*$END*)
  741. PROCEDURE UTMarkDirty*(buffer: Types.Ptr): Types.OSErr;
  742.     (*$IF NOT GENERATINGCFM*)
  743.     INLINE PASCAL $7023, $A824;
  744.     (*$END*)
  745. PROCEDURE UTTrashVolBlocks*(volCtrlBlockPtr: VCBPtr): Types.OSErr;
  746.     (*$IF NOT GENERATINGCFM*)
  747.     INLINE PASCAL $7024, $A824;
  748.     (*$END*)
  749. PROCEDURE UTTrashFileBlocks*(volCtrlBlockPtr: VCBPtr; fileNum: LONGINT): Types.OSErr;
  750.     (*$IF NOT GENERATINGCFM*)
  751.     INLINE PASCAL $7025, $A824;
  752.     (*$END*)
  753. PROCEDURE UTTrashBlocks*(beginPosition: LONGINT; byteCount: LONGINT; volCtrlBlockPtr: VCBPtr; fileRefNum: INTEGER; tbOption: INTEGER): Types.OSErr;
  754.     (*$IF NOT GENERATINGCFM*)
  755.     INLINE PASCAL $7026, $A824;
  756.     (*$END*)
  757. PROCEDURE UTCacheReadIP*(log2PhyProc: (*ΔΔUNIVΔΔ*) Types.Ptr; filePosition: LONGINT; ioBuffer: Types.Ptr; fileRefNum: INTEGER; reqCount: LONGINT; VAR actCount: LONGINT; cacheOption: INTEGER): Types.OSErr;
  758.     (*$IF NOT GENERATINGCFM*)
  759.     INLINE PASCAL $7027, $A824;
  760.     (*$END*)
  761. PROCEDURE UTCacheWriteIP*(log2PhyProc: (*ΔΔUNIVΔΔ*) Types.Ptr; filePosition: LONGINT; ioBuffer: Types.Ptr; fileRefNum: INTEGER; reqCount: LONGINT; VAR actCount: LONGINT; cacheOption: INTEGER): Types.OSErr;
  762.     (*$IF NOT GENERATINGCFM*)
  763.     INLINE PASCAL $7028, $A824;
  764.     (*$END*)
  765. PROCEDURE UTBlockInFQHashP*(vRefNum: INTEGER; diskBlock: LONGINT): Types.OSErr;
  766.     (*$IF NOT GENERATINGCFM*)
  767.     INLINE PASCAL $702C, $A824;
  768.     (*$END*)
  769. (*
  770.  *    File System Manager call prototypes
  771.  *)
  772. PROCEDURE InstallFS*(fsdPtr: FSDRecPtr): Types.OSErr;
  773.     EXTERNAL PASCAL;
  774. PROCEDURE RemoveFS*(fsid: INTEGER): Types.OSErr;
  775.     EXTERNAL PASCAL;
  776. PROCEDURE SetFSInfo*(fsid: INTEGER; bufSize: INTEGER; fsdPtr: FSDRecPtr): Types.OSErr;
  777.     EXTERNAL PASCAL;
  778. PROCEDURE GetFSInfo*(selector: INTEGER; key: INTEGER; VAR bufSize: INTEGER; fsdPtr: FSDRecPtr): Types.OSErr;
  779.     EXTERNAL PASCAL;
  780. PROCEDURE InformFSM*(theMessage: INTEGER; paramBlock: (*ΔΔUNIVΔΔ*) Types.Ptr): Types.OSErr;
  781.     EXTERNAL PASCAL;
  782. PROCEDURE InformFFS*(fsid: INTEGER; paramBlock: (*ΔΔUNIVΔΔ*) Types.Ptr): Types.OSErr;
  783.     EXTERNAL PASCAL;
  784.  
  785. (* $ALIGN RESET*)
  786. (* $POP*)
  787.  
  788.  END FSM.
  789.